<template>
    <div class="weitao-container">
        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
            <p>刷新次数: {{ count }}</p>
            <template v-for="n in total">
                <p :key="n">{{n}}</p>
            </template>
        </van-pull-refresh>
        

    </div>
</template>

<script>
    import {
        PullRefresh,
        Toast
    } from "vant";
    export default {
        name: "Weitao",
        components: {
            [PullRefresh.name]: PullRefresh,
            [Toast.name]: Toast
        },
        data() {
            return {
                count: 0,
                isLoading: false,
                total: 10
            };
        },

        methods: {
            onRefresh() {
                setTimeout(() => {
                    this.$toast("刷新成功");
                    this.isLoading = false;
                    this.count++;
                    this.total += this.total 
                }, 500);
            }
        }
    };
</script>

<style scoped>
</style>